bitkeeper revision 1.387 (3f283841sxL_1BFf_Dks40SWU9PRqg)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Wed, 30 Jul 2003 21:27:29 +0000 (21:27 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Wed, 30 Jul 2003 21:27:29 +0000 (21:27 +0000)
dev.c:
  Fix possible subtle race in new network tx code.

xen/net/dev.c

index b1a87ffb837c984caa9fa6cbaf8c4894168b0138..e9e965c7e954ad8b13178e76fd2d903120602cf8 100644 (file)
@@ -836,6 +836,12 @@ static void tx_skb_release(struct sk_buff *skb)
     __make_tx_response(vif, skb->guest_id, RING_STATUS_OK);
     spin_unlock_irqrestore(&vif->tx_lock, flags);
 
+    /*
+     * Checks below must happen after the above response is posted.
+     * This avoids a possible race with a guest OS on another CPU.
+     */
+    smp_rmb();
+
     if ( (vif->tx_cons == vif->tx_prod) && get_tx_bufs(vif) )
     {
         add_to_net_schedule_list_tail(vif);